package com.chinasofti.shoot;

import java.util.Random;

/**
 *敌机:既是飞行物也是敌人
 */
public class AirePlane extends FlyingObject implements Enemy{

    private int speed = 2;//滑行距离

    public AirePlane(){
        image = ShootGame.airplane;
        width = image.getWidth();
        height = image.getHeight();
        Random random = new Random();
        x = random.nextInt(ShootGame.WIDTH-this.width);
        y = -this.height;
        y = 5;

    }

    @Override
    public int getScore() {
        return 5;
    }

    @Override
    public void step() {
        y += speed;
    }

    @Override
    public boolean outOfBounds() {
        return this.y>ShootGame.HEIGHT;
    }


}
